#include <cstdio>
#include <cstdint>
#include <vector>


struct Slice {
	uint32_t start;
	uint32_t length;
};


class CsvLoader {

private:
	FILE *input;
	unsigned long long file_size;
	uint8_t *buffer;

	uint64_t position;
	bool lastIsCr;

	uint8_t* row_buffer;
	uint32_t row_index;

	Slice read_line();
	void write_row_buffer(uint8_t ch);
public:
	CsvLoader(char* path);
	~CsvLoader();

	std::vector<char*>* read_row();
	size_t size();
};
